import axios from '../../http'

const api = '/api/shipping-address/enabled';

const error = (e) => {
  return () => console.error(e);
};

export default function getShippingAddress(cb, fcb = error('getShippingAddress')) {
  axios.get(api).then(response=> {
    response.data.region = response.data.region.replace(/-/g,' ');
    cb(response.data);
  }).catch( response=> {
    fcb(response);
  })
}